Skip to content

Django span names according to convention#992

Merged
lzchen merged 15 commits intoopen-telemetry:masterfrom
HiveTraum:feature/django-span-name
Sep 21, 2020
Merged

Django span names according to convention#992
lzchen merged 15 commits intoopen-telemetry:masterfrom
HiveTraum:feature/django-span-name

Conversation

@HiveTraum
Copy link
Contributor

@HiveTraum HiveTraum commented Aug 17, 2020

Description

Changed span name extracting method to comply with convention. Besides the inconsistency, the current method had a flaw that could name different handlers with the same name. For example api.v1.cities.main and api.v2.cities.main will have the same name main. There is a case for older versions of django below version 2.2, when it was impossible to get the url pattern. In this case, the full name of the function will be used, indicating the module where this function is located. This will resolve the issue of collisions of the same function names. Changed process_view to process_request as process_view
argument view_func not required anymore

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added 2 unit tests for span names and fixed all other tests

  • test_span_name
  • test_span_name_404

@HiveTraum HiveTraum requested a review from a team August 17, 2020 09:23
@HiveTraum HiveTraum requested a review from aabmass August 25, 2020 05:46
@codeboten codeboten added the instrumentation Related to the instrumentation of third party libraries or frameworks label Sep 3, 2020
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the update!

@lzchen lzchen merged commit ac35858 into open-telemetry:master Sep 21, 2020
alertedsnake pushed a commit to alertedsnake/opentelemetry-python that referenced this pull request Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

instrumentation Related to the instrumentation of third party libraries or frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants